package getRedPacket抢红包;

public class APP {
    public static void main(String[] args) {
        /*
        * 100块分成了三个包,现在有五个人去抢
        * 红包是共享数据
        * 五个人是五条线程
        * */

        // 创建任务对象
        RedPacket rp = new RedPacket();

        // 创建线程对象
        Thread t1 = new Thread(rp);
        Thread t2 = new Thread(rp);
        Thread t3 = new Thread(rp);
        Thread t4 = new Thread(rp);
        Thread t5 = new Thread(rp);

        t1.setName("person1");
        t2.setName("person2");
        t3.setName("person3");
        t4.setName("person4");
        t5.setName("person5");

        t1.start();
        t2.start();
        t3.start();
        t4.start();
        t5.start();

    }
}
